<?php
/**
 * Created by PhpStorm.
 * User: lx
 * Date: 2020/1/7
 * Time: 9:19
 */

namespace app\Validate;


class MemberShipValidate extends RequestValidate
{
    protected function rulesList()
    {
        switch ($this->action) {
            case 'memberRegister':
                return [
                    'share_id' => 'require',
                    'username' => 'require',
                    'nickname' => 'require',
                    'password' => 'require',
                    'level_name' => 'require',
                    'tel' => 'require',
                    'status' => 'require',

                ];
                break;
            case 'memberShare':
                return [
                    'id' => 'require',
                ];
                break;
            case 'addressInsert':
                return [
                    'id' => 'require',
                    'consigner' => 'require',
                    'mobile' => 'require',
                    'province' => 'require',
                    'district' => 'require',
                    'city' => 'require',
                    'address' => 'require',

                ];
                break;
            case 'addressList':
                return [
                    'id' => 'require',
                ];
                break;

            case 'verificationCode':
                return [
                    'phone' => 'require|regex:1[0-9]{10}',
                ];
                break;
            case 'updateAddressDefault':
                return [
                    'id' => 'require',
                    'uid'=>'require'
                ];
                break;
            case 'deleteMemberAddress':
                return [
                    'id' => 'require',
                    'uid'=>'require'
                ];
                break;
        }
    }
}